<?php
namespace App\Http\Controller;

use App\Rpc\Client\DemoClient;

class IndexController
{
    public function demo()
    {
        $data = app('consul-agent')->health('swostar');

        return ['msg'=> '操作成功','status' => 200, 'data' => [$data]];
    }

    public function rpc()
    {
        //远程调用goods服务上的DemoClient控制器的getList方法
        $out = (new DemoClient)->getList();

        return ['msg'=> '操作成功','status' => 200, 'data' => json_decode($out)];
    }
}
